package main

import (
	"fmt"
)

//switch

func grade(score int) string{
	switch  {
	case score < 60:
		return "d"
	case score < 70:
		return "c"
	case score < 80:
		return "b"
	case score <= 100:
		return "a"
	default:
		panic(fmt.Sprintf("Wrong score : %d",score))
	}

}


func result(num int) int{
	sum := 0
	for i := 1;i <=num;i++{
		sum +=i
	}
	return  sum
}

func main(){
	fmt.Println(result(10))
	/*fmt.Println(
		grade(110),
		grade(65),
		grade(100),
		grade(80),
		)
*/
	/*const flename = "01.txt"
	contents,err := ioutil.ReadFile(flename)

	if err != nil{
		fmt.Println(err)
	}else{
		fmt.Printf("%s",contents)
	}

	const flename = "012.txt"
	if contents,err := ioutil.ReadFile(flename); err != nil{
		fmt.Println(err)
	}else{
		fmt.Printf("%s",contents)
	}*/

}
